package com.cms.pms.impl;

import java.util.HashSet;
import java.util.Set;

import com.cms.pms.Aggregator;

public class DefaultAggregator implements Aggregator {

	Set<Aggregator> list = new HashSet<Aggregator>();
	
	@Override
	public void prepare() {
		for (Aggregator ag : list) {
			ag.prepare();
		}
	}

	@Override
	public void handle(Object obj) {
		for (Aggregator ag : list) {
			ag.handle(obj);
		}
	}

	@Override
	public void aggregate() {
		for (Aggregator ag : list) {
			ag.aggregate();
		}
	}

	void addAggregator(Aggregator ag) {
		this.list.add(ag);
	}

}
